using implicit differentiation to find dy